<?xml version="1.0" encoding="UTF-8" ?>
 
<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns="http://www.w3.org/1999/xhtml">
<xsl:template name="reportSelector">
    <div class="reportSelector">
        <xsl:call-template name="reportMain"/>
        <xsl:call-template name="reportByDate"/>
        <xsl:call-template name="graphDays"/>
        <xsl:call-template name="graphWeeks"/>
        <xsl:call-template name="graphMonths"/>
    </div>
</xsl:template>

<xsl:template name="reportMain">
    <xsl:choose>
        <xsl:when test="/root/report = 'main'">
            <div class="report">Суммарный отчёт</div>
        </xsl:when>
        <xsl:otherwise>
            <div class="report"><a href="report.php?module=day&amp;report=main&amp;date1={/root/date1}&amp;date2={/root/date2}">Суммарный отчёт</a></div>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template name="reportByDate">
    <xsl:choose>
        <xsl:when test="/root/report = 'by_date'">
            <div class="report">По датам</div>
        </xsl:when>
        <xsl:otherwise>
            <div class="report"><a href="report.php?module=day&amp;report=by_date&amp;date1={/root/date1}&amp;date2={/root/date2}">По датам</a></div>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template name="graphDays">
    <xsl:choose>
        <xsl:when test="/root/report = 'graph_days'">
            <div class="report">График по дням</div>
        </xsl:when>
        <xsl:otherwise>
            <div class="report"><a href="report.php?module=day&amp;report=graph_days&amp;date1={/root/date1}&amp;date2={/root/date2}">График по дням</a></div>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template name="graphWeeks">
    <xsl:choose>
        <xsl:when test="/root/report = 'graph_weeks'">
            <div class="report">График по неделям</div>
        </xsl:when>
        <xsl:otherwise>
            <div class="report"><a href="report.php?module=day&amp;report=graph_weeks&amp;date1={/root/date1}&amp;date2={/root/date2}">График по неделям</a></div>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<xsl:template name="graphMonths">
    <xsl:choose>
        <xsl:when test="/root/report = 'graph_months'">
            <div class="report">График по месяцам</div>
        </xsl:when>
        <xsl:otherwise>
            <div class="report"><a href="report.php?module=day&amp;report=graph_months&amp;date1={/root/date1}&amp;date2={/root/date2}">График по месяцам</a></div>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

</xsl:stylesheet>